<?php
$smarty->configLoad($lang . '/announcements.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['announcements'];

$user = new user;
if(isset($_POST['submit'])) {
	$sql = 'INSERT INTO '.DB_GAME.'.announcements (announce, faction, type, delay) VALUES (:announce, :faction, :type, :delay)';
	$dbh = $connection->prepare($sql);
	$dbh->bindValue(':announce', $_POST['announce']);
	$dbh->bindValue(':faction', $_POST['faction']);
	$dbh->bindValue(':type', $_POST['type']);
	$dbh->bindValue(':delay', $_POST['delay']);
	$dbh->execute();
	
	$main->jqmodal('addet');
	echo '<meta http-equiv="refresh" content="5; URL=index.php?mod=announcements">';
	
}
$template = 'announcements/add.tpl';
?>
